#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>
int main()
{
	int a;
	double b,price;
	scanf("%d,%lf", &a, &b);
	switch (a)
	{
	case 0:price = 10 + ceil(b - 1) * 3; printf("%lf\n", price); break;
	case 1:price = 10 + ceil(b - 1) * 4; printf("%lf\n", price); break;
	case 2:price = 15 + ceil(b - 1) *5; printf("%lf\n", price); break;
	case 3:price = 15 + ceil(b - 1) * 6.5; printf("%lf\n", price); break;
	case 4:price = 15 + ceil(b - 1) * 10; printf("%lf\n", price); break;
	default:printf("Error in Area\n");
	}
	return 0;
}
